#pragma once


class CFileInfo:public CObject
{
public:
	DECLARE_DYNAMIC(CFileInfo);

public:
	CFileInfo();
	CFileInfo(CFileInfo& obj);
    virtual ~CFileInfo();

public:
    BOOL ReadFromFile(LPCTSTR lpszFilePathName);
    BOOL ReadFromFile(CFile& file);
	BOOL ReadFromFolder(LPCTSTR lpszFolderPathName);
	void UpdateChangeTime(const CTime newTime);
	int operator==(const CFileInfo& obj);
	int operator!=(const CFileInfo& obj);
	int operator==(const CFileStatus& status);
	int operator!=(const CFileStatus& status);
	int operator==(CFile& file);
	int operator!=(CFile& file);
	int operator==(const WIN32_FIND_DATA& finddata);
	int operator!=(const WIN32_FIND_DATA& finddata);
	void Serialize(CArchive& ar);

private:
	void GetFileMD5(CFile& file, BYTE* pMD5);

private:
	BOOL m_bInited;
	BOOL m_bIsFolder;
	CFileStatus m_fsStatus;
	BYTE m_arrMD5[16];
};
